package com.bwie.user.controller;

import com.bwie.common.domain.po.UserPo;
import com.bwie.common.result.Result;
import com.bwie.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 用户名登录
     */
    @GetMapping("/login")
    public Result<UserPo> login(@RequestParam String userName){
        UserPo login = userService.login(userName);
        Result<UserPo> result = Result.success(login);
        return result;
    }
}
